(async function(){        
    //获取得到奖励的一览表
    setLoading(1);
    var history = await getRewardHistory();
    setLoading(0);
    var list = getNode("history");
    var line = list.children[0];
    if(history.length>0){
        clearAll(list);
        for(var i=history.length-1;i>=0;i--){
            if(!history[i].received){
                var newLine = line.cloneNode(true);
                var time = getSubNode(newLine,"time");
                time.innerText = timeFormat(history[i].time);
                var amount = getSubNode(newLine,"amount");
                amount.innerText = format(history[i].amount);
                var reason = getSubNode(newLine,"reason");
                //因为在智能合约中还不知道怎么直接使用汉字，所以这些项目需要手动翻译一下
                if (MESSAGE[history[i].reason]) reason.innerText = MESSAGE[history[i].reason];
                else reason.innerText = history[i].reason;
                list.appendChild(newLine);
            }
        }
    }
})();